//
//  HolidayTableViewCell.m
//  ZAKER
//
//  Created by dllo on 15/8/29.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HolidayTableViewCell.h"

@implementation HolidayTableViewCell

-(void)dealloc
{
    
    [_collButton release];
    [_titleLabel release];
    [_addressLabel release];
    [_MyImage release];
    
    [super dealloc];
    
}

- (void)awakeFromNib
{
  
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.titleLabel = [[UILabel alloc]init];
        _titleLabel.font = [UIFont systemFontOfSize:17];
        _titleLabel.numberOfLines = 0;
        _titleLabel.textAlignment = 1;
        [self.contentView addSubview:_titleLabel];
        [_titleLabel release];
        
        
        self.MyImage = [[UIImageView alloc]init];
        _MyImage.layer.cornerRadius = 20;
        _MyImage.layer.masksToBounds =YES;
        [self.contentView addSubview:_MyImage];
        [_MyImage release];
        
        
        _collButton = [[UIButton alloc]init];
        [self.contentView addSubview:_collButton];
        CGFloat red = 0 % 256;
        CGFloat green = 191 % 256;
        CGFloat blue = 255 % 256;
        
        [_collButton setTitle:@"❤️喜欢" forState:UIControlStateNormal];
        [_collButton setTitleColor:[UIColor colorWithRed:red / 255.0f green:green / 255.0f blue:blue / 255.0f alpha:1] forState:UIControlStateNormal];
        [_collButton release];
        
        
        self.addressLabel = [[UILabel alloc]init];
        _addressLabel.font = [UIFont systemFontOfSize:13];
        _addressLabel.textAlignment = 1;
        _addressLabel.textColor = [UIColor whiteColor];

        [self.MyImage addSubview:_addressLabel];
        [_addressLabel release];
        
    }
    
    return self;
    
}


-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.titleLabel.frame = CGRectMake(20 * myWidth, 10 * myHeight, self.contentView.frame.size.width - 40 * myWidth, 50 *myHeight);
    
    self.MyImage.frame = CGRectMake(20 * myWidth, self.titleLabel.frame.size.height +10 *myHeight, self.contentView.frame.size.width - 40 * myWidth, 155 * myHeight);
    
    _collButton.frame = CGRectMake(150 * myWidth,self.titleLabel.frame.size.height +10 * myHeight + self.MyImage.frame.size.height, 75 * myWidth, 30 * myHeight);
    
    self.addressLabel.frame =CGRectMake(10 * myWidth, self.MyImage.frame.size.height -30 * myHeight, self.MyImage.frame.size.width - 20 * myWidth, 30 * myHeight);
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    
    [super setSelected:selected animated:animated];

}

@end
